package com.ruoyi.category.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.category.mapper.SysTerrainMapper;
import com.ruoyi.category.domain.SysTerrain;
import com.ruoyi.category.service.ISysTerrainService;

/**
 * 地图Service业务层处理
 * 
 * @author yjf
 * @date 2022-07-14
 */
@Service
public class SysTerrainServiceImpl implements ISysTerrainService 
{
    @Autowired
    private SysTerrainMapper sysTerrainMapper;

    /**
     * 查询地图
     * 
     * @param terrainId 地图主键
     * @return 地图
     */
    @Override
    public SysTerrain selectSysTerrainByTerrainId(Long terrainId)
    {
        return sysTerrainMapper.selectSysTerrainByTerrainId(terrainId);
    }

    /**
     * 查询地图列表
     * 
     * @param sysTerrain 地图
     * @return 地图
     */
    @Override
    public List<SysTerrain> selectSysTerrainList(SysTerrain sysTerrain)
    {
        return sysTerrainMapper.selectSysTerrainList(sysTerrain);
    }

    /**
     * 新增地图
     * 
     * @param sysTerrain 地图
     * @return 结果
     */
    @Override
    public int insertSysTerrain(SysTerrain sysTerrain)
    {
        sysTerrain.setCreateTime(DateUtils.getNowDate());
        return sysTerrainMapper.insertSysTerrain(sysTerrain);
    }

    /**
     * 修改地图
     * 
     * @param sysTerrain 地图
     * @return 结果
     */
    @Override
    public int updateSysTerrain(SysTerrain sysTerrain)
    {
        sysTerrain.setUpdateTime(DateUtils.getNowDate());
        return sysTerrainMapper.updateSysTerrain(sysTerrain);
    }

    /**
     * 批量删除地图
     * 
     * @param terrainIds 需要删除的地图主键
     * @return 结果
     */
    @Override
    public int deleteSysTerrainByTerrainIds(Long[] terrainIds)
    {
        return sysTerrainMapper.deleteSysTerrainByTerrainIds(terrainIds);
    }

    /**
     * 删除地图信息
     * 
     * @param terrainId 地图主键
     * @return 结果
     */
    @Override
    public int deleteSysTerrainByTerrainId(Long terrainId)
    {
        return sysTerrainMapper.deleteSysTerrainByTerrainId(terrainId);
    }
}
